home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / ada / adaed-1.11 / adaed-1 / Adaed-1.11.0a / vars.ch < prev    next >
Encoding:
Text File  |  1992-02-07  |  8.1 KB  |  289 lines

  1. /*
  2.  * Copyright (C) 1985-1992  New York University
  3.  * 
  4.  * This file is part of the Ada/Ed-C system.  See the Ada/Ed README file for
  5.  * warranty (none) and distribution info and also the GNU General Public
  6.  * License for more details.
  7.  
  8.  */
  9. H#ifndef _vars_h
  10. H#define _vars_h
  11.  
  12. C#include "hdr.h"
  13.  
  14. /* vars.ch - global declarations and initializations */
  15.  
  16. /*
  17.  *T+ GLOBAL DECLARATIONS and DEFINITIONS
  18.  *S+ Constants
  19.  */
  20.  
  21. X double    ADA_MIN_REAL INIT((-79228162514264337593543950336.0));/* - 2.0**96 */
  22. X double    ADA_MAX_REAL INIT(79228162514264337593543950336.0);/* 2.0**96 */
  23. X int    ADA_REAL_DIGITS INIT(6);
  24. X int    cdebug2;
  25.  
  26. X Declaredmap declared_all[4];    /* array of standard declareds */
  27. X int    full_others;  /* a boolean */
  28. X int    fold_context; /* a boolean */
  29. X int    node_count;
  30. X Node current_node;
  31. X Node OPT_NODE;    /*initialized in sem0 */
  32.  
  33. /* Initialized in SEMINIT */
  34. /*
  35. ??const qualifiers = {as_qual_range,  as_qual_length,  as_qual_discr,
  36.             as_qual_arange, as_qual_alength, as_qual_adiscr };
  37.  */
  38.  
  39. /*S+ Variables*/
  40.  /* declared map from standard environment */
  41. /*base_declared is array of copies of maps for standard0,standard,
  42. umnentionable0, and ascii. base_declared_symbols is corresponding
  43. array of symbol table pointers */
  44. X Declaredmap base_declared[4];
  45. X Symbol base_declared_symbols[4];
  46. X Tuple scope_st;            /* stack of lexical scopes */
  47. X Tuple has_return_stk;        /* stack to track return statements */
  48. X Tuple newtypes;            /* list of type declaration code to be */
  49.  /* emitted before declaration being processed. */
  50. X Tuple lab_seen;            /* set of labels in procedure . */
  51. X Tuple current_instances;    /* stack for recursive instantiation check */
  52.  
  53. X Symbol scope_name;        /* unique name for each scope */
  54. X char *unit_name;        /* compilation unit information */
  55. X Tuple all_vis;            /* Modules whose visibility is required */
  56.                 /* all_vis used only in ch. 10 */
  57.  
  58. X Tuple open_scopes;        /* nest of currently open scopes, from inner */
  59.  /* to outer.  Outermost is STANDARD. */
  60. X Tuple used_mods;        /* packages appearing in a use clause */
  61. X Tuple vis_mods;    /* list of package names visible in this unit*/
  62.  
  63. X int    noop_error;
  64.  
  65.  /* used by procs init_compunit and compunit. */
  66. X Set non_local_names;        /* To collect non_local references in each subp. */
  67.  
  68. X int    out_context;        /* Signals valid appearance of out parameter.  */
  69.  
  70. X Symbol
  71. symbol_and,
  72. symbol_andthen,
  73. symbol_any,
  74. symbol_any_id,
  75. symbol_array_type,
  76. symbol_ascii,
  77. symbol_assign,
  78. symbol_boolean,
  79. symbol_boolean_type,
  80. symbol_callable,
  81. symbol_character,
  82. symbol_character_type,
  83. symbol_constrained,
  84. symbol_constraint_error,
  85. symbol_daccess,
  86. symbol_dfixed,
  87. symbol_discrete_type,
  88. symbol_divfx,
  89. symbol_duration,
  90. symbol_eq,
  91. symbol_exception,
  92. symbol_float,
  93. symbol_ge,
  94. symbol_gt,
  95. symbol_in,
  96. symbol_incomplete,        /* incomplete, for incp_types */
  97. symbol_integer,
  98. symbol_le,
  99. symbol_left,
  100. symbol_limited,            /* limited for priv_types, incp_types */
  101. symbol_limited_private,        /* cf. symbol_limited */
  102. symbol_long_float,
  103. symbol_long_integer,
  104. symbol_lt,
  105. symbol_main_task_type,
  106. symbol_mulfx,
  107. symbol_natural,
  108. symbol_none,
  109. symbol_not,
  110. symbol_ne,
  111. symbol_notin,
  112. symbol_null,
  113. symbol_numeric,
  114. symbol_numeric_error,
  115. symbol_or,
  116. symbol_order_type,
  117. symbol_orelse,
  118. symbol_overloaded,
  119. symbol_positive,
  120. symbol_private,            /* for priv_types, incp_types */
  121. symbol_program_error,
  122. symbol_right,
  123. symbol_short_integer,
  124. symbol_short_integer_base,
  125. symbol_standard,
  126. symbol_standard0,
  127. symbol_storage_error,
  128. symbol_system_error,
  129. symbol_string,
  130. symbol_string_type,
  131. symbol_system,
  132. symbol_tasking_error,
  133. symbol_undef,
  134. symbol_universal_dfixed,
  135. symbol_universal_fixed,
  136. symbol_universal_integer,
  137. symbol_universal_integer_1,
  138. symbol_universal_real,
  139. symbol_unmentionable,
  140. symbol_xor;
  141.  
  142. /* following used in Chapter 4 mainly for check_type */
  143. X Symbol 
  144. symbol_universal_type,
  145. symbol_integer_type,
  146. symbol_real_type,
  147. symbol_composite_type,
  148. symbol_equal_type;
  149.  
  150.  
  151. X Symbol
  152. symbol_addu,  /* +u */
  153. symbol_subu,  /* -u */
  154. symbol_abs,  /* abs */
  155. symbol_add,  /* + */
  156. symbol_sub,  /* - */
  157. symbol_mul,  /* * */
  158. symbol_div,  /* / */
  159. symbol_mod,  /* mod */
  160. symbol_rem,  /* rem */
  161. symbol_exp,  /* ** */
  162. symbol_cat,  /* & */
  163. /* new symbols for the catenation operations */
  164. symbol_cat_cc, /* &cc */
  165. symbol_cat_ac, /* &ac */
  166. symbol_cat_ca, /* &ca */
  167. symbol_modi,  /* modi */
  168. symbol_remi,  /* remi */
  169. symbol_addui,  /* +ui */
  170. symbol_subui,  /* -ui */
  171. symbol_absi,  /* absi */
  172. symbol_addi,  /* +i */
  173. symbol_subi,  /* -i */
  174. symbol_muli,  /* *i */
  175. symbol_divi,  /* /i */
  176. symbol_addufl,    /* +ufl */
  177. symbol_subufl,    /* -ufl */
  178. symbol_absfl,  /* absfl */
  179. symbol_addfl,  /* +fl */
  180. symbol_subfl,  /* -fl */
  181. symbol_mulfl,  /* *fl */
  182. symbol_divfl,  /* /fl */
  183. symbol_addufx,    /* +ufx */
  184. symbol_subufx,    /* -ufx */
  185. symbol_absfx,  /* absfx */
  186. symbol_addfx,  /* +fx */
  187. symbol_subfx,  /* -fx */
  188. symbol_mulfxi,    /* *fxi */
  189. symbol_mulifx,    /* *ifx */
  190. symbol_divfxi,    /* /fxi */
  191. symbol_mulfli,    /* *fli */
  192. symbol_mulifl,    /* *ifl */
  193. symbol_divfli,    /* /fli */
  194. symbol_expi,  /* **i */
  195. symbol_expfl;  /* **fl */
  196.  
  197. X Tuple unary_sig;
  198. X Tuple binary_sig; /* TBSL: to be initialized in sem0*/
  199.  
  200. X int num_predef_units; /* number of units in predef.ada */
  201.  
  202. X int errors INIT(FALSE); /* flag if errors are present*/
  203.  
  204. /* adaval_overflow is set to indicate overflow from adaval; corresponds
  205.  * to SETL ADAVAL returning 'OVERFLOW'
  206.  */
  207. X int adaval_overflow; 
  208. X char *FILENAME;
  209. X FILE *MSGFILE INIT(stdout);
  210. /* added 24 sep 84*/
  211. /* init_nodes is tuple of nodes needed by save_tree (10) */
  212. X Tuple init_nodes;
  213. X Tuple init_symbols; /* tuple of symbols created by sem initialization*/
  214. /* varying length tuple, unit_nodes_n gives current length */
  215. X Tuple unit_nodes;
  216. #ifdef TBSL
  217. X int unit_nodes_n INIT(0);
  218. #endif
  219. X char *PREDEFNAME; /* name of predef file */
  220. X char *AISFILENAME;
  221. X int lib_option INIT(FALSE);
  222. X int new_library INIT(FALSE); /* set if creating library */
  223. X struct unit *pUnits[MAX_UNITS+1];
  224. X Tuple lib_stub;
  225. X Tuple stub_info;
  226.  
  227. X int seq_node_n INIT(0); /* number of nodes allocated */
  228. X Tuple seq_node; /* tuple of allocated nodes*/
  229. X int seq_symbol_n INIT(0);/* number of symbols allocated*/
  230. X Tuple seq_symbol;    /* tuple of allocated symbols */
  231.  
  232. /* added 12 oct 84 to track nodes read from ast */
  233. X int unit_number_now INIT(0);
  234. X int unit_numbers INIT(0);
  235. X int empty_unit_slots INIT(0);
  236.  
  237. /* following variables used to trap references to selected node or symbol.
  238.  * Node specified by trapns and trapnu (giving node sequence and unit),
  239.  * symbol specified by trapss and trapsu (giving symbol sequence and unit).
  240.  * These are meaningful only if either nonzero. When a trapped node referenced,
  241.  * then procedure trap is called.
  242.  * Code to watch for traps is planted at several places, notably sym_new,
  243.  * node_new, zptupsym, zptupnod (these latter two do not call trap).
  244.  */
  245. X int trapns INIT(0),trapnu INIT(0),trapss INIT(0),trapsu INIT(0);
  246.  
  247. X Tuple aisunits_read;
  248.  
  249. X Nodemap node_map;
  250. /* OPT_NAME is used by code_generator but defined here so it can be
  251.  * referenced from libr procedures */
  252. X Symbol OPT_NAME; /* This is to symbols what OPT_NODE is to nodes*/
  253.  
  254. /* I/O trace flags used to get trace prints when reading and writing
  255.  * intermediate files. A trace level is one of the following:
  256.  *    0    no trace
  257.  *    1    brief trace
  258.  *    2    full trace.
  259.  */
  260. X int iot_ifile INIT(0); /* current trace level for ifile */
  261. X int iot_ofile INIT(0); /* current trace level for ofile */
  262. X int iot_ais_r INIT(0); /* trace level for ais files read */
  263. X int iot_ais_w INIT(0); /* trace level for ais files written */
  264. X int iot_tre_r INIT(0); /* trace level for tre files read */
  265. X int iot_tre_w INIT(0); /* trace level for tre files written */
  266. X int iot_lib_r INIT(0); /* trace level for lib files read */
  267. X int iot_lib_w INIT(0);/* set to trace writing lib file */
  268. X char iot_ofile_type;
  269. X char iot_ifile_type;
  270.  
  271. /* compiling predef */
  272. X int    compiling_predef INIT(0); /* set if we are compiling predef */
  273.  
  274. /* the following are used to avoid having string literals in code that
  275.  * might be overlaid on the PC 
  276.  */
  277. X char *string_any_id  INIT("any_id"); 
  278. X char *string_ok  INIT("ok");
  279. X char *string_ds  INIT("$D$");
  280. /* variables to report result from power_of_2(), thus avoiding
  281.  * need to compute a tuple, as is done in SETL version.
  282.  */
  283. X int power_of_2_accuracy; 
  284. X int power_of_2_power;
  285. X Rational power_of_2_small;
  286. X Set stubs_to_write;
  287. X Tuple NOT_CHOSEN;
  288. H#endif
  289.